A type checked prototype-based model with linearity
نویسندگان
چکیده
Dynamic inheritance, originating in the Self programming language, is the ability of an object to change the code that it inherits at run time. This ability is useful for modeling objects that behave in different ways at different points in the object’s lifecycle. Unstructured dynamic inheritance, however, allows arbitrary changes to the interface of the object, and thus is incompatible with statically typechecked languages such as C++, C# and Java. This paper provides a more structured facility for dynamic inheritance, where a type system tracks the changes in an object’s interface that occur as the inheritance hierarchy is changed. We define a formal model of a language and type system with dynamic inheritance, and prove that the type system is sound in that it prevents run-time type errors. The type system tracks the linearity of objects and methods in order to ensure that objects whose interfaces change are not aliased. |socket < −()| ”a new empty object” socket AddSlots: (|bind = (< code > ... socket AddSlots: (|port < −Nil|) ”adding a new data slot” socket AddSlots: (|listen = (< code > ... socket AddSlots: (|accept = (< code > ... socket AddSlots: (|read = (< code >)|) socket AddSlots: (|write = (| : data...| < code >)|) socket AddSlots: (|close = (< code >)|) )|))|))|) Figure 1: TCP socket example illustrating the expressiveness of Self and the challenges the type system has to deal with
منابع مشابه
On the Desing and Test of a Prototype of Biped Actuated by Shape Memory Alloys
In this paper the design of a biped robot actuated with Shape Memory Alloy (SMA) springs with minimum degrees of freedom is presented. SMA springs are a class of smart materials that are known for their high power to mass and volume ratios. It was shown that utilizing spring type of SMAs have many advantages as large deformation, smooth motion, silent and clean movement compared to ordinary typ...
متن کاملIdentification and Robust Fault Detection of Industrial Gas Turbine Prototype Using LLNF Model
In this study, detection and identification of common faults in industrial gas turbines is investigated. We propose a model-based robust fault detection(FD) method based on multiple models. For residual generation a bank of Local Linear Neuro-Fuzzy (LLNF) models is used. Moreover, in fault detection step, a passive approach based on adaptive threshold is employed. To achieve this purpose, the a...
متن کاملPredictors of speeding among drivers based on Prototype Willingness Model
Background: Every year 1.2 millions of people are killed in road accident, and speeding is a major contributor road crashes among young driver. Accounting 40% of fatal crashes involved speeding. The purpose of this study was determining predictor of speeding intention among young driver 19-25 years old young driver in ghaemshahr based on Prototype Willingness Model. Materials and methods: I...
متن کاملThe Study Predictors of Fast-Food Consumption based on the Prototype/Willingness Model in Students of Public Health School, Rafsanjan City, Iran
Introduction: In recent decades, a significant increase has been observed in the average weight of people due to fast food consumption, which increases the risk of developing diabetes and cardiovascular diseases. Given the importance of this issue, this study was conducted to investigate the predictors of fast food consumption based on the Prototype/Willingness Model among students the School...
متن کاملPredictors of Fast Food Consumption Based on Prototype/Willingness Model among Students of Yazd University of Medical Sciences
Background: Consumption of fast food, as a consequence of the modern industrial society, has increased in recent years among teenagers and young people. The purpose of this study was to investigate the effect of fast food consumption on female students in Yazd University of Medical Sciences based on the Prototype/Willingness Model. Methods: In this descriptive-analytic study, 245 female dormito...
متن کامل